package cm.mefobe.android.telecomcost.entities;

import java.util.ArrayList;

public class CallHistory {

	public CallHistory(ArrayList<Call> _calls, TimePeriod _period) {
		super();
		this._calls = _calls;
		this._period = _period;
	}

	public CallHistory() {
		super();
	}

	private ArrayList<Call> _calls;
	private TimePeriod _period;

	protected void setCalls(ArrayList<Call> _calls) {
		this._calls = _calls;
	}

	public ArrayList<Call> getCalls() {
		return _calls;
	}

	protected void setPeriod(TimePeriod period) {
		this._period = period;
	}

	public double getCost() {
		double cost = 0;
		if (_calls != null) {
			int index = 0;
			while (index < _calls.size()) {
				cost = cost + _calls.get(index).getCost();
				index++;
			}
		}

		return cost;
	}

	public TimePeriod getPeriod() {
		return _period;
	}
}
